home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 3420A.ZIP / TW150L.ZIP / TSDWIN.CH < prev    next >
Text File  |  1992-05-06  |  15KB  |  362 lines

  1. //------------------------------------------------------------------------
  2. //
  3. //                            TSDWIN.CH
  4. //
  5. //                Header File for Use with TSDWIN.LIB
  6. //                     Clipper 5.0 Window Library
  7. //
  8. //      Copyright (C) 1992 Trilateral Systems Development Ltd.
  9. //    All Rights Reserved * Version 1.50 * Release Date: 01-25-92
  10. //
  11. //                         18 Bond St. South
  12. //                        Dundas, ON,  Canada
  13. //                              L9H 3H1
  14. //                           416-628-5086
  15. //
  16. //------------------------------------------------------------------------
  17.  
  18. #define TSD_HSEP        "═╤═"
  19. #define TSD_CSEP        " │ "
  20. #define TSD_FSEP        "═╧═"
  21.  
  22. #define RSHIFT          01 //      1       0x0001
  23. #define LSHIFT          02 //      2       0x0002
  24. #define CTRL            03 //      4       0x0004
  25. #define ALT             04 //      8       0x0008
  26. #define SCROLLSTAT      05 //     16       0x0010
  27. #define NUMLOCKSTAT     06 //     32       0x0020
  28. #define CAPLOCKSTAT     07 //     64       0x0040
  29. #define INSERTSTAT      08 //    128       0x0080
  30. #define CTRLNUMLKSTAT   09 //   2048       0x0800
  31. #define SCROLLOCK       10 //   4096       0x1000
  32. #define NUMLOCK         11 //   8192       0x2000
  33. #define CAPLOCK         12 //  16384       0x4000
  34. #define INSERT          13 //  32768       0x8000
  35.  
  36. #define TRUE            .T.
  37. #define YES             .T.
  38.  
  39. #define FALSE           .F.
  40. #define NO              .F.
  41.  
  42. #define MACOMP(cexpr)   &("{||" + cexpr + "}")
  43.  
  44. #ifdef DEBUG
  45.     #define ASSERT(expl, func) IIF(expl, "", func(procline()))
  46. #else
  47.     #define ASSERT(expl, func)
  48. #endif
  49.  
  50. #define LOG10( num )    LOG( num ) / LOG( 10 )
  51. #define ISPUNCT( mVar )  ( mVar >= 43 .AND. mVar <= 47 )
  52.  
  53. //------------------------------------------------------------------------
  54. // Translates
  55. //------------------------------------------------------------------------
  56. #translate STRINT(<x>)     => LTRIM(STR(INT(<x>)))
  57. #translate STRNUM(<x>)     => LTRIM(STR(<x>))
  58. #translate ISNIL( <v1> )   => ( <v1> == NIL )
  59. #translate ISARR( <v1> )   => ( VALTYPE(<v1>) == "A" )
  60. #translate ISBLK( <v1> )   => ( VALTYPE(<v1>) == "B" )
  61. #translate ISCHAR( <v1> )  => ( VALTYPE(<v1>) == "C" )
  62. #translate ISDATE( <v1> )  => ( VALTYPE(<v1>) == "D" )
  63. #translate ISLOGI( <v1> )  => ( VALTYPE(<v1>) == "L" )
  64. #translate ISMEMO( <v1> )  => ( VALTYPE(<v1>) == "M" )
  65. #translate ISNUM( <v1> )   => ( VALTYPE(<v1>) == "N" )
  66. #translate ISOBJ( <v1> )   => ( VALTYPE(<v1>) == "O" )
  67.  
  68. //------------------------------------------------------------------------
  69. // Commands
  70. //------------------------------------------------------------------------
  71. #command ASHRINK( <array>, <size> ) ;
  72.          => ;
  73.          ASIZE( <array>, IIF( <size>  == NIL, LEN( <array> ) - 1, <size> ))
  74.  
  75. #command AEXPAND( <array>, <number> ) ;
  76.          => ;
  77.          ASIZE( <array>, IIF( <number> == NIL, 1, <number> ))
  78.  
  79. #command REPEAT => DO WHILE .T.
  80. #command UNTIL <lexp> => IF (<lexp>); EXIT; END; END
  81.  
  82. #command DEFAULT <p> TO <val> [,<pn> TO <valn>] ;
  83.          => ;
  84.          <p> := IIF(<p> == NIL, <val>, <p>) ;
  85.          [;<pn> := IIF(<pn> == NIL, <valn>, <pn>)]
  86.  
  87. //------------------------------------------------------------------------
  88. //  Window Constants
  89. //------------------------------------------------------------------------
  90. #define WINTOP            _twTop()
  91. #define WINLEFT           _twLeft()
  92. #define WINBOTTOM         _twBottom()
  93. #define WINRIGHT          _twRight()
  94. #define WINLENGTH         _twBottom()-_twTop()+1
  95. #define WINWIDTH          _twRight()-_twLeft()+1
  96. #define WINHANDLE         _twHandle()
  97. #define WINSHADOW         _twShadow()
  98. #define WINTHICK          _twShTh()
  99. #define WINSTRUCT         _twStructure()
  100. #define WINTITLE          _twTitle()
  101. #define WINCOLOR          _twColor()
  102. #define WINFCOLOR         _twFcolor()
  103. #define WINFRAME          _twFrame()
  104. #define GETSTACK          _twArray()
  105.  
  106. #define EXPLODEON         twExplode( .T. )
  107. #define EXPLODEOFF        twExplode( .F. )
  108.  
  109. //------------------------------------------------------------------------
  110. //  Scroll Bar Constants
  111. //------------------------------------------------------------------------
  112. #define SB_ROWTOP         1
  113. #define SB_COLTOP         2
  114. #define SB_ROWBOTTOM      3
  115. #define SB_COLBOTTOM      4
  116. #define SB_COLOR          5
  117. #define SB_POSITION       6
  118. #define SB_DIRECTION      7
  119. #define SB_MOUSEID        8
  120.  
  121. #define SB_ELEMENTS       8  // The number of elements defining a scroll bar
  122.                               // data structure
  123.  
  124. // The Up and Down arrows, highlight and background char's for the thumb tab
  125. #define SB_UPARROW        CHR(  24 )
  126. #define SB_DNARROW        CHR(  25 )
  127. #define SB_LEFTARROW      CHR(  27 )
  128. #define SB_RIGHTARROW     CHR(  26 )
  129. #define SB_HIGHLIGHT      CHR( 219 )
  130. #define SB_BACKGROUND     CHR( 176 )
  131.  
  132. // Directions for scroll bars
  133. #define SB_HORIZONTAL     1
  134. #define SB_VERTICAL       2
  135.  
  136. #define MHIDE             IIF( lOKMouse, _twM2(), .T. )
  137. #define MSHOW             IIF( lOKMouse, _twM1(), .T. )
  138. #define MOKSHOW           IIF(( lOKMouse := twOKMouse() ), _twM1(), .T. )
  139.  
  140. //------------------------------------------------------------------------
  141. //  Window Commands
  142. //------------------------------------------------------------------------
  143. #command  WINDOW ;
  144.           => ;
  145.           twOpen()
  146.  
  147. #command  WINDOW TO <whandle>;
  148.           => ;
  149.           <whandle> := twOpen()
  150.  
  151. #command  WINDOW AT [<top>], [<left>], [<bottom>], [<right>] ;
  152.           [COLOR <mcolor>] ;
  153.           [SHADOW <mshadow>] ;
  154.           [FRAME <mframe>] ;
  155.           [FILL <mfill>] ;
  156.           [FCOLOR <mfcolor>] ;
  157.           [TITLE <mtitle>] ;
  158.           => ;
  159.           twOpen( <top>, <left>, <bottom>, <right>, <mcolor>, <mshadow>, ;
  160.                  <mframe>, <mfill>, <mfcolor>, <mtitle> )
  161.  
  162. #command  WINDOW TO <whandle> AT [<top>], [<left>], [<bottom>], [<right>] ;
  163.           [COLOR <mcolor>] ;
  164.           [SHADOW <mshadow>] ;
  165.           [FRAME <mframe>] ;
  166.           [FILL <mfill>] ;
  167.           [FCOLOR <mfcolor>] ;
  168.           [TITLE <mtitle>] ;
  169.           => ;
  170.           <whandle> := twOpen( <top>, <left>, <bottom>, <right>, <mcolor>, ;
  171.                         <mshadow>, <mframe>, <mfill>, <mfcolor>, <mtitle> )
  172.  
  173. #xcommand  WINHEADER <*title*> ;
  174.           =>;
  175.           twTitle( #<title> )
  176.  
  177. #xcommand  WINFOOTER <*title*> ;
  178.           =>;
  179.           twTitle( #<title>,, "B", "C" )
  180.  
  181. #xcommand  WINBORDER [FRAME <frame>] [COLOR <color>];
  182.           =>;
  183.           twFrame( <frame>, <color> )
  184.  
  185. //------------------------------------------------------------------------
  186. //  Menu and SAY.. GET.. Commands
  187. //------------------------------------------------------------------------
  188. #command  @ <row>, <col> WSAY <cexpr> [COLOR <color>] [PICTURE <picture>];
  189.           => ;
  190.           twSay( <row>, <col>, <cexpr>, <color>, <picture> )
  191.  
  192. #command @ <row>, <col> WPROMPT <prompt> [MESSAGE <msg>] [COLOR <color>] ;
  193.          [WHEN <when>] [ACTION <action>];
  194.          =>;
  195.          IIF( aMenu == NIL, aMenu := {}, NIL )            ;
  196.          ;AADD( aMenu, { twRow( <row> ), twCol( <col> ), <prompt>, ;
  197.                         <msg>, <color>, <{when}>, <{action}> })
  198.  
  199. #command WMENU TO <v>                                                    ;
  200.       => <v> := twMenuTo( {|_1| if(PCount() == 0, <v>, <v> := _1)}, #<v>, aMenu );
  201.          ;aMenu := {}                                     ;
  202.  
  203. //------------------------------------------------------------------------
  204. //  Message System Commands
  205. //------------------------------------------------------------------------
  206. #command INFORM <message> [HEADER <header>] [WAIT <wait>] ;
  207.                 [TOP <top>] [LEFT <left>] ;
  208.                 [SHADOW <mshadow>] [FRAME <mframe>] ;
  209.          => ;
  210.          twInfo( <message>, <header>, <wait>, <top>, <left>, ;
  211.                 <mshadow>, <mframe> )
  212.  
  213. #command INQUIRE <message> TO <getvar> [HEADER <header>] ;
  214.                  [TOP <top>] [LEFT <left>] ;
  215.                  [SHADOW <mshadow>] [FRAME <mframe>] ;
  216.          => ;
  217.          <getvar> := twInquire( <message>, <header>, <getvar>, <top>, <left>, ;
  218.                 <mshadow>, <mframe> )
  219.  
  220. #command WARNING <message> [HEADER <header>] [WAIT <wait>] ;
  221.                  [TOP <top>] [LEFT <left>] ;
  222.                  [SHADOW <mshadow>] [FRAME <mframe>] ;
  223.          => ;
  224.          twWarn( <message>, <header>, <wait>, <top>, <left>, ;
  225.                 <mshadow>, <mframe> )
  226.  
  227. #command MSGTEXT <message> [HEADER <header>] [WAIT <wait>] ;
  228.                  [<top>], [<left>], [<bottom>], [<right>] ;
  229.                  [COLOR <color>] [SHADOW <mshadow>] [FRAME <mframe>] ;
  230.          => ;
  231.          twTextMsg( <message>, <header>, <wait>, <top>, <left>, ;
  232.                   <bottom>, <right>, ;
  233.                   <color>, <mshadow>, <mframe> )
  234.  
  235. //------------------------------------------------------------------------
  236. //  Alert System Commands
  237. //------------------------------------------------------------------------
  238. #command BUTTONBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
  239.          [WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
  240.          AT [<top>], [<left>], [<bottom>], [<right>] ;
  241.          [SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
  242.          [ACTIONKEYS <actionkeys>] ;
  243.          => ;
  244.          <mvar> := twButtonBox( <"orient">, <message>, <title>, <nobuttons>, ;
  245.          <choices>, <start>, <top>, <left>, <bottom>, <right>, ;
  246.          <shadow>, <frame>, <exitkey>, <actionkeys> )
  247.  
  248. #command CHECKBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
  249.          [WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
  250.          AT [<top>], [<left>], [<bottom>], [<right>] ;
  251.          [SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
  252.          [ACTIONKEYS <actionkeys>] ;
  253.          => ;
  254.          <mvar> := twCheckBox( <"orient">, <message>, <title>, <nobuttons>, ;
  255.          <choices>, <start>, <top>, <left>, <bottom>, <right>, ;
  256.          <shadow>, <frame>, <exitkey>, <actionkeys> )
  257.  
  258. #command RADIOBOX [<orient:H,V>] TO <mvar> [MESSAGE <message>] [TITLE <title>] ;
  259.          [WITH <nobuttons> BUTTONS] [CHOICES <choices>] [START <start>] ;
  260.          AT [<top>], [<left>], [<bottom>], [<right>] ;
  261.          [SHADOW <shadow>] [FRAME <frame>] [EXITKEY <exitkey>] ;
  262.          [ACTIONKEYS <actionkeys>] ;
  263.          => ;
  264.          <mvar> := twRadioBox( <"orient">, <message>, <title>, <nobuttons>, ;
  265.          <choices>, <start>, <top>, <left>, <bottom>, <right>, ;
  266.          <shadow>, <frame>, <exitkey>, <actionkeys> )
  267.  
  268. //------------------------------------------------------------------------
  269. //  Browse System Commands
  270. //------------------------------------------------------------------------
  271. #command BROWSEARRAY <array> AT [<top>], [<left>], [<bottom>], [<right>] ;
  272.          [TITLE <title>] [HEADERS <headers>] [FOOTERS <footers>] ;
  273.          [EDIT <edit>] [ACTIONKEYS <actionkeys>] [COLOR <color>] ;
  274.          [SHADOW <shadow>] [FRAME <frame>] [FRAMECOLOR <framecolor>] ;
  275.          [AUTOLITE <autolite>] [FREEZE <freeze>] ;
  276.          => ;
  277.          twArBrowse( <top>, <left>, <bottom>, <right>, ;
  278.           <array> , <title>, <headers>, <footers>, ;
  279.           <edit>, <actionkeys>, <color>, <shadow>, <frame>, <framecolor>, ;
  280.           <autolite>, <freeze> )
  281.  
  282. #command BROWSEARRAY <array> TO <mvar> AT [<top>], [<left>], ;
  283.          [<bottom>], [<right>] ;
  284.          [TITLE <title>] [HEADERS <headers>] [FOOTERS <footers>] ;
  285.          [EDIT <edit>] [ACTIONKEYS <actionkeys>] [COLOR <color>] ;
  286.          [SHADOW <shadow>] [FRAME <frame>] [FRAMECOLOR <framecolor>] ;
  287.          [AUTOLITE <autolite>] [FREEZE <freeze>] ;
  288.          => ;
  289.          <mvar> := twArBrowse( <top>, <left>, <bottom>, <right>, ;
  290.                       <array> , <title>, <headers>, <footers>, ;
  291.                       <edit>, <actionkeys>, <color>, <shadow>, ;
  292.                       <frame>, <framecolor>, ;
  293.                       <autolite>, <freeze> )
  294.  
  295. #command BROWSEDBF AT [<top>], [<left>], [<bottom>], [<right>] ;
  296.          [COLUMNS <columns>] [TITLE <title>] [FOOTERS <footers>] ;
  297.          [TOPBLOCK <topblock>] [BOTTOMBLOCK <bottomblock>] ;
  298.          [SCOPEBLOCK <scopeblock>] [EDIT <edit>] ;
  299.          [ACTIONKEYS <actionkeys>] [COLOR <color>] [SHADOW <shadow>] ;
  300.          [FRAME <frame>] [FRAMECOLOR <framecolor>] [SCROLLBAR <scrollbar>] ;
  301.          [MESSAGES <messages>] [AUTOLITE <autolite>] [FREEZE <freeze>] ;
  302.          [STABILIZE <stabilize>] ;
  303.          => ;
  304.          twDBrowse( <top>, <left>, <bottom>, <right>, ;
  305.             <columns>, <title>, <footers>, <topblock>, ;
  306.             <bottomblock>, <scopeblock>, <edit>, <actionkeys>, ;
  307.             <color>, <shadow>, <frame>, <framecolor>, <scrollbar>, ;
  308.             <messages>, <autolite>, <freeze>, <stabilize> )
  309.  
  310. #command BROWSEDBF TO <mvar> AT [<top>], [<left>], [<bottom>], [<right>] ;
  311.          [COLUMNS <columns>] [TITLE <title>] [FOOTERS <footers>] ;
  312.          [TOPBLOCK <topblock>] [BOTTOMBLOCK <bottomblock>] ;
  313.          [SCOPEBLOCK <scopeblock>] [EDIT <edit>] ;
  314.          [ACTIONKEYS <actionkeys>] [COLOR <color>] [SHADOW <shadow>] ;
  315.          [FRAME <frame>] [FRAMECOLOR <framecolor>] [SCROLLBAR <scrollbar>] ;
  316.          [MESSAGES <messages>] [AUTOLTE <autolte>] [FREEZE <freeze>] ;
  317.          [STABILIZE <stabilize>] ;
  318.          => ;
  319.          <mvar> := twDBrowse( <top>, <left>, <bottom>, <right>, ;
  320.                       <columns>, <title>, <footers>, <topblock>, ;
  321.                       <bottomblock>, <scopeblock>, <edit>, <actionkeys>, ;
  322.                       <color>, <shadow>, <frame>, <framecolor>, <.scrollbar.>, ;
  323.                       <.messages.>, <.autolte.>, <freeze>, <.stabilize.> )
  324.  
  325. //------------------------------------------------------------------------
  326. //  Calculator Commands
  327. //------------------------------------------------------------------------
  328. #command CALCINIT AT <top>, <left> [COLOR <color>] [SHADOW <shadow>] ;
  329.                      [FRAME <frame>] [PASTE <paste>] ;
  330.          => ;
  331.          twCalcInit( <top>, <left>, <color>, <shadow>, <frame>, <.paste.> )
  332.  
  333. #command CALCINIT ;
  334.          => ;
  335.          twCalcInit()
  336.  
  337. #command CALCULATOR TO <nkey> ;
  338.          => ;
  339.          SET KEY <nkey> TO twCallCalc()
  340.  
  341. #command RESET CALCULATOR ;
  342.          => ;
  343.          ERASE *.CLC
  344.  
  345. //------------------------------------------------------------------------
  346. //  Miscellaneous Commands and Translates
  347. //------------------------------------------------------------------------
  348. #translate MAKEWSHAD( <r1>, <c1>, <r2>, <c2> ) ;
  349.            => ;
  350.            RESTSCREEN( <r1>, <c1>, <r2>, <c2>, _twAttrChg(;
  351.            SAVESCREEN( <r1>, <c1>, <r2>, <c2> ), IIF( ISCOLOR(), 8, 7 )))
  352.  
  353. #command GETSTRUCT ;
  354.          => ;
  355.          twGetStruct(@sT,@sL,@sB,@sR,@wT,@wL,@wB,@wR,@tShadow,@tScr,;
  356.             @uScr,@tlength,@twidth,@tThick,@sh13,@sh17,@sh79,@sh39)
  357.  
  358. #command SETSTRUCT ;
  359.          => ;
  360.          twSetStruct(wT,wL,wB,wR,sT,sL,sB,sR,uScr)
  361.  
  362.